import request from '@/utils/request'

// 查询题目收藏列表
export function listQuestionFavorite(query) {
  return request({
    url: '/exam/questionFavorite/list',
    method: 'get',
    params: query
  })
}

// 查询题目收藏所有列表
export function listAllQuestionFavorite(query) {
  return request({
    url: '/exam/questionFavorite/listAll',
    method: 'get',
    params: query
  })
}

// 查询我的收藏题目列表
export function myFavorites(query) {
  return request({
    url: '/exam/questionFavorite/myFavorites',
    method: 'get',
    params: query
  })
}

// 查询题目收藏详细
export function getQuestionFavorite(favoriteId) {
  return request({
    url: '/exam/questionFavorite/getInfo/' + favoriteId,
    method: 'get'
  })
}

// 新增题目收藏
export function addQuestionFavorite(data) {
  return request({
    url: '/exam/questionFavorite/add',
    method: 'post',
    data: data
  })
}

// 修改题目收藏
export function updateQuestionFavorite(data) {
  return request({
    url: '/exam/questionFavorite/edit',
    method: 'post',
    data: data
  })
}

// 删除题目收藏
export function delQuestionFavorite(query) {
  return request({
    url: '/exam/questionFavorite/delQuestionFavorite',
    method: 'get'
  })
}

// 取消收藏
export function cancelQuestionFavorite(data) {
  return request({
    url: '/exam/questionFavorite/cancel',
    method: 'get',
    params: data
  })
}

// 获取用户收藏的指定题库的题目信息
export function getBankFavoriteQuestionInfo(bankId) {
  return request({
    url: '/exam/questionFavorite/bankFavoriteQuestionInfo/' + bankId,
    method: 'get'
  })
}